/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.talent.util.data.*;
import cn.javaxc.system.mapper.system.LayoutEditMapper;
public class LayoutEdit extends BaseAction
{
    @Autowired(required=false)
	private LayoutEditMapper mapper;
    /**
    修改布局
    */
    
    public Map layoutEdit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> layout=mapper.layout(params);
        SQLMap layout_emt=layout.getExistfirst();
        result.put("layout", layout_emt);
        
        
        SQLList<SQLMap> layout_item=mapper.layout_item(params);
        result.put("layout_item", layout_item);
        
        return result;
    }
    /**
    修改布局修改
    */
    
    public Map layoutEditSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        XmlParserUtil.parseLayout(context);
        
        
        mapper.layoutEditSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("layout_item")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_layout_item(params);
        }
        
        return result;
    }
}